import request from '@/utils/request';

/**
 * 技师提现列表
 * @param params 查询条件
 */

export async function withdrawalList(params) {
  const res = await request.get('/massage/technicianWithdrawal/page', {
    params
  });

  if (res.data.code === 200) {
    return res.data.data;
  }
  return Promise.reject(new Error(res.data.message));
}
// 提现列表头部数据
export async function getTechnicianlistHead(params) {
  const res = await request.get(
    '/massage/technicianWithdrawal/getTechnicianlistHead',
    {
      params
    }
  );

  if (res.data.code === 200) {
    return res.data.data;
  }
  return Promise.reject(new Error(res.data.message));
}
// 技师审核提现接口
export async function technicianWithdrawal(data) {
  const res = await request.post(
    '/massage/technicianWithdrawal/withdrawal',
    data
  );
  if (res.data.code === 200) {
    return res.data.message;
  }
  return Promise.reject(new Error(res.data.message));
}

//   分销列表删除接口
export async function technicianWithdrawalDelete(id) {
  const res = await request.delete('/massage/technicianWithdrawal/' + id);
  console.log(res);
  if (res.data.code === 200) {
    return res.data.message;
  }
  return Promise.reject(new Error(res.data.message));
}
export async function technicianWithdrawalBatch(data) {
  const res = await request.delete('/massage/technicianWithdrawal/batch', {
    data
  });
  if (res.data.code === 200) {
    return res.data.message;
  }
  return Promise.reject(new Error(res.data.message));
}
